package my.edu.constant;

import my.edu.model.bills.bound.service.IAssemblyOrderService;
import my.edu.model.bills.bound.service.IDisassemblyOrderService;
import my.edu.model.bills.bound.service.IOtherInboundOrderService;
import my.edu.model.bills.bound.service.IOtherOutboundOrderService;
import my.edu.model.bills.fund.service.IOtherExpenseOrderService;
import my.edu.model.bills.fund.service.IOtherIncomeOrderService;
import my.edu.model.bills.fund.service.IPreReceiptOrderService;
import my.edu.model.bills.fund.service.IReceiptOrderService;
import my.edu.model.bills.purchase.service.IPurchaseOrderService;
import my.edu.model.bills.purchase.service.IPurchaseReturnOrderService;
import my.edu.model.bills.sales.service.ILogisticsServiceService;
import my.edu.model.bills.sales.service.ISalesOrderService;
import my.edu.model.bills.sales.service.ISalesReturnOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class BillsType {
    public static final String PURCHASE = "purchase";//采购单
    public static final String PURCHASERETURN = "purchaseReturn";//采购退货单
    public static final String SALES = "sales";//销售单
    public static final String SALESRETURN = "salesReturn";//销售退货单
    public static final String OTHERINBOUND = "otherInbound";//其他入库单
    public static final String OTHEROUTBOUND = "otherOutbound";//其他出库单
    public static final String OTHERINCOME = "otherIncome";//其他收入单
    public static final String OTHEREXPENSE = "otherExpense";//其他支出单
    public static final String RECEIPT = "receipt";//收款单
    public static final String PRERECEIPT = "preceipt";//预收款单
    public static final String LOGISTICSSERVICE = "logisticsService";//物流服务
    public static final String ASSEMBLY = "assembly";//组装单
    public static final String DISASSEMBLY = "disassembly";//拆卸单
    public static final String PurchaseSalesExpenses="PurchaseSalesExpenses";


    @Autowired
    private IPurchaseOrderService purchaseOrderService;
    @Autowired
    private IPurchaseReturnOrderService purchaseReturnOrderService;
    @Autowired
    private ISalesOrderService salesOrderService;
    @Autowired
    private ISalesReturnOrderService salesReturnOrderService;
    @Autowired
    private IOtherInboundOrderService otherInboundOrderService;
    @Autowired
    private IOtherOutboundOrderService otherOutboundOrderService;
    @Autowired
    private IOtherIncomeOrderService otherIncomeOrderService;
    @Autowired
    private IOtherExpenseOrderService otherExpenseOrderService;
    @Autowired
    private IReceiptOrderService receiptOrderService;
    @Autowired
    private IPreReceiptOrderService preReceiptOrderService;
    @Autowired
    private IAssemblyOrderService assemblyOrderService;
    @Autowired
    private ILogisticsServiceService logisticsServiceService;
    @Autowired
    private IDisassemblyOrderService disassemblyOrderService;


    public Object getBillsTypeService(String type) {
        return switch (type) {
            case PURCHASE -> purchaseOrderService;
            case PURCHASERETURN -> purchaseReturnOrderService;
            case SALES -> salesOrderService;
            case SALESRETURN -> salesReturnOrderService;
            case OTHERINBOUND -> otherInboundOrderService;
            case OTHEROUTBOUND -> otherOutboundOrderService;
            case OTHERINCOME -> otherIncomeOrderService;
            case OTHEREXPENSE -> otherExpenseOrderService;
            case RECEIPT -> receiptOrderService;
            case PRERECEIPT -> preReceiptOrderService;
            case LOGISTICSSERVICE -> logisticsServiceService;
            case DISASSEMBLY -> disassemblyOrderService;
            case ASSEMBLY -> assemblyOrderService;
            default -> "未知";
        };
    }
}